package spring_advice;

import org.springframework.aop.ThrowsAdvice;

import java.lang.reflect.Method;

public class TransactionManager implements ThrowsAdvice {

    public void afterThrowing(Method method, Object[] args, Object target, Exception ex) {
        System.out.println("-------");
        System.out.println("method:" + method.getName());
        System.out.println("P抛出异常:" + ex.getMessage());
        System.out.println("回滚事务");
    }

}
